package com.bgs.service.impl;

import com.bgs.mapper.WriteoffMapper;
import com.bgs.pojo.Invoice;
import com.bgs.pojo.Writeoff;
import com.bgs.service.WriteoffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @program: xkgc
 * @description:
 * @author: Mr.Zhao
 * @create: 2022-05-17 21:06
 */
@Service
public class WriteoffServiceImpl implements WriteoffService {

    @Autowired
    private WriteoffMapper writeoffMapper;

    @Override
    public List<Writeoff> findAllFinance(String ordernumber, Integer type) {
        return writeoffMapper.findAllFinance(ordernumber,type);
    }

    @Override
    public int shenFvo(Invoice invoice) {
        LocalDateTime localDateTime = LocalDateTime.now();
        invoice.setRiseType(1);
        invoice.setCreationTime(localDateTime);
        invoice.setUpdateTime(localDateTime);
        invoice.setIsDel("n");

        return writeoffMapper.shenFvo(invoice);
    }
}
